<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.infomanage.po.*" %>
<%@page import="com.infomanage.vo.*" %>
<%@page import="com.infomanage.enums.*"%>
<%@page import="com.infomanage.service.study.*"%>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<%
	request.setCharacterEncoding("UTF-8");
	String itemId = request.getParameter("itemId");
    if(itemId == null) itemId = "";
    
    StudyPhysicalTestItem item = StudyPhysicalTestService.loadStudyPhysicalTest(request, response, out);
    String age = "";
    String bmi = "";
    String evaluation = "";
    int evaluationLevel= 0;
    String fatLevel = "";
    String gripK = "";
    String gripN = "";
    String height = "";
    String lungCapacity = "";
    String metabolism = "";
    String personName = "";
    int personId = 0;
    String portraitJump = "";
    String pushUps = "";
    String reactionTime = "";
    String score = "";
    String serialNumber = "";
    int sex = 1;
    String sitForward = "";
    String sitUps = "";
    String suggest = "";
    String timestamp = "";
    String weight = "";
    int starLevel = 0;
    
    if(item != null) {
    	StudyPhysicalTest bean = item.getBean();
    	Person person = item.getPerson();
    	age = bean.getAge();
    	bmi = bean.getBmi();
    	evaluation = bean.getEvaluation();
    	evaluationLevel = bean.getEvaluationLevel();
    	fatLevel = bean.getFatLevel();
    	gripK = bean.getGripK();
    	gripN = bean.getGripN();
    	height = bean.getHeight();
    	lungCapacity = bean.getLungCapacity();
    	metabolism = bean.getMetabolism();
    	personName = person.getName();
    	personId = person.getPersonId();
    	portraitJump = bean.getPortraitJump();
    	pushUps = bean.getPushUps();
    	reactionTime = bean.getReactionTime();
    	score = bean.getScore();
    	serialNumber = bean.getSerialNumber();
    	sex = bean.getSex();
    	sitForward = bean.getSitForward();
    	sitUps = bean.getSitUps();
    	suggest = bean.getSuggest();
    	timestamp = bean.getTimestamp();
    	weight = bean.getWeight();
    	starLevel = bean.getStarLevel();
    } 
%>
<html>
<head>
	<title>体质测试</title>
	<link href="../../css/table.css" rel="stylesheet" type="text/css">
	<link href="../../css/calendar.css" rel="stylesheet" type="text/css">
	<style type="text/css">
		.field2{
			background: #D1DDEF;
			text-align: center;
			font-weight: bold;
		}
	</style>
	<script type="text/javascript" src="../../js/calendar.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript">
	 function init() {
		   if("" != "<%=itemId%>") { // 修改
		   }
	   }
	   // 提交
	   function doSubmit(){
	   		form1.actionType.value = "add";
		 	form1.submit();
	   }

	   function validate(){
	   		if(form1.timestamp.value == ""){
	   			alert("日期不能为空！");
	   			return true;
	   		}
	   		if(form1.personName.value == -1){
	   			alert("姓名不能为空！");
	   			return true;
	   		}
	   		return false;
	   }
	   function showError(error){
		   alert(error);
	   }

	   function showInfo(info){
		   alert(info);
		   window.returnValue = "ok";
		   window.close();
	   }
	</script>
</head>
<body  rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" onclick="clickBody();" onload="init();">
	<form name="form1" action="physiqueTest_action.jsp" method="post" target="actionFrame">
	<input type="hidden" name="itemId" value="<%=itemId%>">
	<input type="hidden" name="actionType">
	<table class="dialogTable" cellpadding="0" cellspacing="0">
		<!-- 表头-->
		<tr class="dialogTableHeader">
			<td>体质测试</td>
		</tr>
		<!-- 表数据-->
		<tr class="dialogTableContent">
			<td height="100%">
				<!-- 数据项 -->
				<div style="height: 100%;overflow: auto;">
				<table style="table-layout: fixed;" border="0">
					<col width="16%">
					<col width="22%">
					<col width="14%">
					<col width="12%">
					<col width="28%">
					<tr>
						<td>
							编号：&nbsp;&nbsp;<%=serialNumber %>
						</td>
						<td>
							姓名：&nbsp;&nbsp;<%=personName %>
						</td>
						<td>
							性别：<%=SexType.valueOf(sex).title() %>
						</td>
						<td align="center">
							年龄：&nbsp;&nbsp;<%=age %>&nbsp;&nbsp;岁
						</td>
						<td>
							测试日期：
							<%=timestamp %>
						</td>
					</tr>
				</table>
				<!-- 基本检测数据 -->
				<table class="dataTable2">
					<col width="15%">
					<col width="30%">
					<col width="30%">
					<col width="25%">
					<tr>
						<td class="field" rowspan="6">
							<b>基本检测数据</b>
						</td>
						<td>
							身高:&nbsp;&nbsp;<%=height %>&nbsp;&nbsp; 厘米
						</td>
						<td>
							体重: &nbsp;&nbsp;<%=weight %>&nbsp;&nbsp;公斤
						</td>
						<td>
							肺活量:&nbsp;&nbsp;<%=lungCapacity %>&nbsp;&nbsp;毫升
						</td>
					</tr>
					<tr>
						<td>
							握力: &nbsp;&nbsp;<%=gripK %> &nbsp;&nbsp;公斤力
							&nbsp;&nbsp;<%=gripN %>&nbsp;&nbsp; 牛顿
						</td>
						<td>
							俯卧撑（男）:&nbsp;&nbsp; <%=pushUps %>&nbsp;&nbsp;个
						</td>
						<td colspan="2">
							仰卧起坐: &nbsp;&nbsp;<%=pushUps %>&nbsp;&nbsp;个
						</td>
					</tr>
					<tr>
						<td>
							坐位体前屈:&nbsp;&nbsp;<%=sitForward %>&nbsp;&nbsp;秒
						</td>
						<td>
							反应时:&nbsp;&nbsp;<%=reactionTime %>&nbsp;&nbsp;秒
						</td>
						<td>
							纵跳:&nbsp;&nbsp;<%=portraitJump %>&nbsp;&nbsp;厘米
						</td>
					</tr>
					<tr>
						<td>
							体质指数BMI:&nbsp;&nbsp;<%=bmi %>
						</td>
						<td>
							肥胖度:&nbsp;&nbsp;<%=fatLevel %>
						</td>
						<td>
							基础代谢:&nbsp;&nbsp;<%=metabolism %>&nbsp;&nbsp;千卡
						</td>
					</tr>
				</table>
				
				<table class="dataTable2">
					<col width="15%">
					<col width="85%">
					<tr>
						<td class="field">
							<b>综合评价</b>
						</td>
						<td style="height: 150;padding-left:0px">
							<table cellpadding="0" cellspacing="0" style="table-layout: fixed;height: 100%;width: 100%;border: none;">
								<col width="30">
								<col width="30">
								<col width="40">
								<tr style="20px">
									<td height="100%" style="border: none;">
										总体平均得分:&nbsp;&nbsp;<%=pushUps %>	
									</td>
									<td height="100%" style="border: none;">
										总体评价:&nbsp;&nbsp;
										<%=EvaluationLevelType.valueOf(evaluationLevel).title() %>
									</td>
									<td height="100%" style="border: none;">
										星级:&nbsp;&nbsp;	<%=StarLevelType.valueOf(starLevel).title() %>
									</td>
								</tr>
								<tr>
									<td colspan="3" height="120px" style="border: none;">
										<textarea style="width: 100%;height: 100%;background-color:#dfe8f6" readonly><%=pushUps %></textarea>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<table class="dataTable2">
					<col width="15%">
					<col width="85%">
					<tr>
						<td class="field">
							<b>运动及营养建议</b>
						</td>
						<td height="180px">
							<textarea style="width: 100%;height: 100%;background-color:#dfe8f6" readonly><%=suggest %></textarea>
						</td>
					</tr>
				</table>
				</div>
			</td>
		</tr>
		<tr>
			<td class="tableBtn">
				<span onclick="window.print();">打印</span>			
				<span onclick="window.close();">关闭</span>
			</td>
		</tr>
		<tr valign="top">
			<td>
				&nbsp;
			</td>
		</tr>
	</table>
	<iframe src="#" frameborder="0" id="treeFrame" name="frame" style="display: none;position: absolute;"></iframe>
	<iframe src="#" name="actionFrame" style="display: none;"></iframe>
</body>
</html>